package com.atguigu.dga.governance.assessor.storage;

import com.atguigu.dga.governance.assessor.Assessor;
import com.atguigu.dga.governance.bean.AssessParam;
import com.atguigu.dga.governance.bean.GovernanceAssessDetail;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * ClassName: TableEmptyAssessor
 * Package: com.atguigu.dga.governance.assessor.storage
 * Description:
 *
 * @Author:
 * @Create: 2024/3/18 10:20
 * @Version: 1.0
 */
@Component("TABLE_EMPTY")
public class TableEmptyAssessor extends Assessor {
    @Override
    public void checkProblem(AssessParam assessParam, GovernanceAssessDetail governanceAssessDetail) {
        Long tableSize = assessParam.getTableMetaInfo().getTableSize();
        if(tableSize == null || tableSize == 0L) {
            governanceAssessDetail.setAssessScore(BigDecimal.ZERO);
            governanceAssessDetail.setAssessProblem("表为空");
        }
    }
}
